<html><head><title>Residents</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="5">Residents</font></b></p>

<b>Description</b><br><blockquote>

Residents are precompiled files which are loaded when the compiler starts. They can be found in the 'residents' 
folder of the PureBasic installation path. A resident file must have the extension '.res' and can contain the 
following items: <a href="../reference/structures.html">structures</a>, <a href="../reference/interfaces.html">interfaces</a>, 
<a href="../reference/macros.html">macros</a> and <a href="../reference/general_rules.html">constants</a>. It can not contain 
dynamic code or <a href="../reference/procedures.html">procedures</a>. <br>
<br>
When a resident is loaded, all its content is available for the program being compiled. That's why all 
built-in constants like <font color="#924B72">#PB_Event_CloseWindow</font> are available, they are in the 'PureBasic.res' file. 
All the API structures and constants are also in a resident file. Using residents is a good way to 
store the common macros, structure and constants so they will be available for every programs. 
When distributing an user library, it's also a nice solution to provide the needed constants and structures, 
as PureBasic does. <br>
<br>
To create a new resident, the <a href="../reference/cli_compiler.html">command-line compiler</a> needs to be used, as there is no option to do it from the IDE. 
It is often needed to use /IGNORERESIDENT and /CREATERESIDENT at the same time to avoid duplicate errors, as the previous version 
of the resident is loaded before creating the new one. <br>
<br>
Residents greatly help to have a faster compilation and compiler start, as all the information is stored 
in binary format. It is much faster to load than parsing an include file at every compilation. 
</body></html>